using Cysharp.Threading.Tasks;

namespace EventBus
{
    /// <summary>
    /// 异步广播消息， 消息监听方可以异步处理消息
    /// </summary>
    public interface IEventBroadcastAsync
    {
        /// <summary>
        /// 异步广播消息， 消息监听方可以异步处理消息
        /// </summary>
        /// <param name="sender">发送方</param>
        /// <param name="eventName">事件名</param>
        /// <returns>有监听方，返回true， 没有监听方，返回false</returns>
        UniTask<bool> BroadcastAsync(object sender, string eventName);

        UniTask<bool> BroadcastAsync<T1>(object sender, string eventName, T1 arg1);

        UniTask<bool> BroadcastAsync<T1, T2>(object sender, string eventName, T1 arg1, T2 arg2);

        UniTask<bool> BroadcastAsync<T1, T2, T3>(object sender, string eventName, T1 arg1, T2 arg2, T3 arg3);

        UniTask<bool> BroadcastAsync<T1, T2, T3, T4>(object sender, string eventName, T1 arg1, T2 arg2, T3 arg3, T4 arg4);

        UniTask<bool> BroadcastAsync<T1, T2, T3, T4, T5>(object sender, string eventName, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5);

        UniTask<bool> BroadcastAsync<T1, T2, T3, T4, T5, T6>(object sender, string eventName, T1 arg1, T2 arg2, T3 arg3, T4 arg4,
            T5 arg5, T6 arg6);

        UniTask<bool> BroadcastAsync<T1, T2, T3, T4, T5, T6, T7>(object sender, string eventName, T1 arg1, T2 arg2, T3 arg3, T4 arg4,
            T5 arg5, T6 arg6, T7 arg7);

        UniTask<bool> BroadcastAsync<T1, T2, T3, T4, T5, T6, T7, T8>(object sender, string eventName, T1 arg1, T2 arg2, T3 arg3, T4 arg4,
            T5 arg5, T6 arg6, T7 arg7, T8 arg8);
    }
}